print("学生火车票优惠如下:\n"   
      "1、每年的1-3月和7-9月凭学生证可打5折。\n"
      "2、10人(含10人)以上团购还可打9折。"
      )
value = int(input("请输入单张火车票的全价:(1~1000):"))
student = input("是否为学生(Y/N):")
month = int(input("请输入当前月份(1-12):"))
number = int(input("请输入需要订票的人数:"))
if student == "n":
    value = value * number
elif month >= 1 and month <= 3 or month >= 7 and month <= 9:
    value = (value * number) * 0.5
else:
    value = value * number

if number >= 10:
    value = value * 0.9
    print(f"您应付的金额是:{value}")
else:
    print(f"您应付的金额是:{value}")

